<?php
class DoEditProfileAction extends FrontendAction
{
	public function __construct($context)
	{
		parent::__construct($context);
		$userDao = new UserDao();
		$userAttrConfs = $userDao->getUserAttrConfs();
		foreach ($userAttrConfs as $conf)
		{
			$this->dtds[FormItemRender::getItemName($conf)] = array(
				"label" => $conf["caption"],
				"rules" => $conf["validator_conf"]["rules"],
				"explain" => $conf["validator_conf"]["explain"],
			);
		}		
	}

	public function execute()
	{
		$this->view->result = UserService::updateUser($_POST);
		$this->view->render();
	}
}
